package com.weather.service;

import java.util.List;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import com.weather.vo.City;
import com.weather.vo.WeatherResponse;

/**
 * @Description 伪 zuul 客户端
 *
 * @author 堆堆堆
 * @date 2018年6月7日 下午5:27:16
 */
@FeignClient(name="weather-eureka-client-zuul",fallback=DataClientFallback.class)
public interface DataClient {

	/**
	 * @Description 获取城市列表
	 *
	 * @return
	 * @throws Exception
	 */
	@GetMapping("/city/cities")
	List<City> listCity() throws Exception;
	
	/**
	 * @Description 根据城市 id 查询天气数据
	 *
	 * @param cityId
	 * @return
	 */
	@GetMapping("/data/weather/cityId/{cityId}")
	WeatherResponse getDataByCityId(@PathVariable("cityId") String cityId);
}
